/*  -------------------------- (C) COPYRIGHT 2022 Fortiortech ShenZhen ---------------------------*/
/**
 * @copyright (C) COPYRIGHT 2022 Fortiortech Shenzhen
 * @file      LED.c
 * @author    Fortiortech  Appliction Team
 * @since     Create:2022-07-14
 * @date      Last modify:2022-07-14
 * @note      Last modify author is Leo.li
 * @brief      
 */

/* Define to prevent recursive inclusion --------------------------------------------------------*/
#ifndef __LED_H_
#define __LED_H_
//#define PID_CONTROL_TEM

/* Exported types -------------------------------------------------------------------------------*/
typedef struct
{
	uint8 ledCycle; // 周期调节闪烁
	uint8 ledCycleFactor;//值为1~255，周期倍率，定时TIM3的ARR值，每档CNTR达到ledCycleFator的时候触发一次计数，ledCounter +1;
	uint16 ledCounter;//0~65535
	uint8 RDuty;	// 红光占空比，亮度占比
	uint8 GDuty;	// 红光占空比，亮度占
	uint8 BDuty;	// 红光占空比，亮度占
	uint8 ledMaxDuty;
	uint8 ledMinDuty;
	uint8 ledUpStep;
	uint8 ledDownStep;
	uint8 ledBreathONOFF;
	uint8 ledUpDownFlag; // 1亮->暗,0：暗->亮
	uint16 hotTime;//热风时间
	uint16 coldTime;//冷风时间
	uint16 timeCnt;//时间计数
	uint8 tempMode;//冷风热风模式，0为冷风，1为热风
} ledCt1_TypeDef;

/* Exported variables ---------------------------------------------------------------------------*/
extern ledCt1_TypeDef ledCt1;
// extern const uint8 ScrOnAngleTable[15][2];

/* Exported functions ---------------------------------------------------------------------------*/
extern void LEDControl(void);
extern void ledInit(void);
extern void RGB(uint8 Rdt, uint8 Gdt, uint8 Bdt);
extern void RGB_ONOFF(uint8 Rdt, uint8 Gdt, uint8 Bdt);
extern void ledBreath(uint8 breathONOFF); // led呼吸，可以放1ms中断里面
extern uint8 gcd(uint8 a, uint8 b);
extern void tempCal(uint8 TempPercentVal);

#endif
